package com.ioc.demo.component;

import com.ioc.demo.model.Student;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 王圆豪
 * Date: 2025-07-03
 * Time: 22:57
 */
@Component
public class UserComponent {
    @Autowired
    @Qualifier("s2")
//    @Resource(name = "s1")
    private Student student;

    public void print(){
        System.out.println("userComponent");
        System.out.println(student.toString());
    }
}
